﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataLib.Accounts.Bus;
using System.Data;
using DataLib.Common;
using DataLib.Model;

namespace Ewts.Storage
{
    public partial class CJOModify : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ListItem item = new ListItem();
                item.Text = "--请选择--";
                item.Value = "";
                DataLib.BLL.City bllCity = new DataLib.BLL.City();

                // 处理地
                ddlWasteDisposePlace.DataSource = bllCity.GetList("flag1='02'");
                ddlWasteDisposePlace.DataTextField = "cityname";
                ddlWasteDisposePlace.DataValueField = "cityname";
                ddlWasteDisposePlace.DataBind();
                ddlWasteDisposePlace.Items.Insert(0, item);


                //参数为CJOID
                if (Request["CJOID"] != null && Request["CJOID"].ToString().Trim() != "")
                {
                    int cjoid = int.Parse(Request["CJOID"].Trim());
                    DataLib.Model.Cjo cmodel = new DataLib.BLL.Cjo().GetModel(cjoid);
                    if (cmodel.islocal ==false )
                    {
                        Response.Redirect("CJONonlocalApply.aspx?cjoid=" + cjoid.ToString());
                        return;
                    }
                    BindByCJOID(cjoid);
                }
                else
                {
                    DataLib.Common.MessageBox.Show(Page,"无此CJO！");
                }

                string username = "";
                if (Session["UserInfo"] != null)
                {
                    User curUser = new DataLib.Accounts.Bus.User();
                    curUser = (User)Session["UserInfo"];
                    username = curUser.UserName;
                }
                else
                {
                    Response.Redirect("/accounts/login.aspx");
                }

            }
        }

        #region 加载数据
        /// <summary>
        /// 通过CJOID绑定数据
        /// </summary>
        /// <param name="CJOID">页面参数CJOID</param>
        protected void BindByCJOID(int CJOID)
        {

            DataLib.Model.CJOItem cjoModel = new CJOItem();
            DataLib.BLL.CJOItem bcitem = new DataLib.BLL.CJOItem();
            cjoModel = bcitem.GetListByCid(CJOID);
            
            DataLib.Model.LoadNum loadNumModel = new DataLib.BLL.LoadNum().GetModel(cjoModel.loadnumid);

            //if (loadNumModel.customerid != 0 && loadNumModel.customerid.ToString().Trim() != "" && loadNumModel.addressid != null && loadNumModel.addressid.ToString().Trim() != "")
            //{
                //DataLib.Model.Cumtomer customerModel = new DataLib.BLL.Cumtomer().GetModel((int)loadNumModel.customerid);
                //DataLib.Model.CumtomerAddress cumAddrModel = new DataLib.BLL.CumtomerAddress().GetModel((int)loadNumModel.addressid);
                DataLib.Model.Cjo cmodel = new DataLib.BLL.Cjo().GetModel(CJOID);
                hidbussinesstype.Value = cmodel.bussinesstype;
                if (cmodel.bussinesstype != null && cmodel.bussinesstype != "") 
                {
                    if (cmodel.bussinesstype == "销毁")
                    {
                        bussDest.Checked = true;
                    }
                    else if(cmodel.bussinesstype == "利用")
                    {
                        bussUsed.Checked = true;
                    }
                    else
                    {
                        bussNone.Checked = true;
                    }
                    hidtyz.Value = cmodel.istyz;
                    switch (cmodel.istyz)
                    { 
                        case "无":
                            tyzNone.Checked = true;
                            break;
                        case "直销":
                            tyzZx.Checked = true;
                            break;
                        case "退运":
                            tyzTy.Checked = true;
                            break;
                        case "服务":
                            tyzFw.Checked = true;
                            break;
                        default:
                            break;
                    }
                }
                //string[] newWaste = loadNumModel.RubbishType.Split(';'); 
                string[] newWaste = cjoModel.RubbType.Split(';');
                for (int i = 0; i < newWaste.Length; i++)
                {
                    if (newWaste[i] == cbWasteName1.Text)
                        cbWasteName1.Checked = true;
                    //if (newWaste[i] == cbWasteName2.Text)
                    //    cbWasteName2.Checked = true;
                    //if (newWaste[i] == cbWasteName3.Text)
                    //    cbWasteName3.Checked = true;
                    if (newWaste[i] == cbWasteName4.Text)
                        cbWasteName4.Checked = true;
                    if (newWaste[i] == cbWasteName5.Text)
                        cbWasteName5.Checked = true;
                    if (newWaste[i] == cbWasteName6.Text)
                        cbWasteName6.Checked = true;
                }
                
                txtLoadNum.Text = loadNumModel.loadnum;
                txtCJO.Text = cjoModel.cjono;
                txtGoodsInfo.Text = cjoModel.goodsdesc;
                lblBelong.Text = cjoModel.belongArea;

                txtSaleman.ToolTip = cjoModel.cjoshowmanusername;
                txtSaleman.Text = cjoModel.cjoshowmantruename;

                ddlWasteDisposePlace.SelectedValue = loadNumModel.Rubbisharea;

                txtCustomerCode.Text = loadNumModel.cumcode;
                txtCompany.Text = loadNumModel.cumname;
                txtmemo.Text = cjoModel.cjoremark;

                #region 临时使用 2013年05月10日 需要修改CJOITEM
                DataLib.Model.Cjo cModel = new DataLib.BLL.Cjo().GetModel(cjoModel.cjoid);
                txtCustomerContactor.Text =cModel.cjolinkman;
                txtCustomerPhoneNum.Text = cModel.cjophone;
                txtCollectAddress.Text = cModel.cjoadd;
                #endregion
                hidLoadID.Value = cjoModel.loadnumid.ToString();
                txtGoodsWeight.Text = Convert.ToInt32(cjoModel.predictweight).ToString();

                string[] collectDate = cjoModel.collectdate.ToString().Split(' ');
                txtCollectDate.Text = collectDate[0];
                txtCollectTime.Text = collectDate[1];
                txtNoticeDate.Text = cjoModel.createtime.ToString();
                
                
                

                //绑定VehicleRequire数据
                DataLib.Model.VehicleRequire vReqModel = new DataLib.BLL.VehicleRequire().GetModel(cjoModel.vehichlerequireid);
                txtWorkerCount.Text = vReqModel.workercount.ToString();
                txtGoodsCount.Text = vReqModel.numberestimate.ToString();
                txtOtherCost.Text = vReqModel.othercost.ToString().Split('.')[0];
                txtOtherRequire.Text = vReqModel.otherrequire;
                txtVehiRequire.Text = vReqModel.other;
                txtqt.Text = vReqModel.othervrequire;
                switch (vReqModel.clearingform)
                {
                    case "单次结":
                        rblPayType1.Checked = true;
                        break;
                    case "多次结":
                        rblPayType2.Checked = true;
                        break;
                    case "零结":
                        rblPayType3.Checked = true;
                        break;
                    case "年费":
                        rblPayType4.Checked = true;
                        break;
                    default:
                        rblPayType1.Checked = true;
                        break;
                }
                //if (vReqModel.clearingform == rblPayType1.Text)
                //    rblPayType1.Checked = true;
                //else
                //    rblPayType2.Checked = true;

                
                #region 需要工具
                string[] toolsReqList = vReqModel.tools.Split(',');
                for (int index = 0; index < toolsReqList.Length; index += 2)
                {
                    if (rbTools1.Text == toolsReqList[index])
                    {
                        rbTools1.Checked = true;
                        
                        txtTools1.Text = toolsReqList[index + 1].Split(';')[0];
                    }
                    if (rbTools2.Text == toolsReqList[index])
                    {
                        rbTools2.Checked = true;
                        txtTools2.Text = toolsReqList[index + 1].Split(';')[0];
                    }
                    if (rbTools3.Text == toolsReqList[index])
                    {
                        rbTools3.Checked = true;
                        txtTools3.Text = toolsReqList[index + 1].Split(';')[0];
                    }
                    if (rbTools4.Text == toolsReqList[index])
                    {
                        rbTools4.Checked = true;
                        txtTools4.Text = toolsReqList[index + 1].Split(';')[0];
                    }
                    if (rbTools5.Text == toolsReqList[index])
                    {
                        rbTools5.Checked = true;
                        txtTools5.Text = toolsReqList[index + 1].Split(';')[0];
                    }
                    if (rbTools6.Text == toolsReqList[index])
                    {
                        rbTools6.Checked = true;
                        txtTools6.Text = toolsReqList[index + 1].Split(';')[0];
                    }
                } 
                #endregion

                #region 物料状态
                string[] cbMaternReqList = vReqModel.maternrequire.Split(';');
                for (int index = 0; index < cbMaternReqList.Length; index++)
                {
                    if (cbMaternRequire1.Text == cbMaternReqList[index])
                        cbMaternRequire1.Checked = true;
                    if (cbMaternRequire2.Text == cbMaternReqList[index])
                        cbMaternRequire2.Checked = true;
                    if (cbMaternRequire3.Text == cbMaternReqList[index])
                        cbMaternRequire3.Checked = true;
                } 
                #endregion

                #region 采样要求
                string[] rblSamplingReqList = vReqModel.samplingrequire.Split(';');
                for (int index = 0; index < rblSamplingReqList.Length; index++)
                {
                    if (rblSamplingRequire1.Text == rblSamplingReqList[index])
                        rblSamplingRequire1.Checked = true;
                    if (rblSamplingRequire2.Text == rblSamplingReqList[index])
                        rblSamplingRequire2.Checked = true;
                    if (rblSamplingRequire3.Text == rblSamplingReqList[index])
                        rblSamplingRequire3.Checked = true;
                } 
                #endregion

                #region 特殊要求
                string[] cbPeculiarReqList = vReqModel.peculiarrequire.Split(';');
                for (int index = 0; index < cbPeculiarReqList.Length; index++)
                {

                    if (cbPeculiarRequire1.Text == cbPeculiarReqList[index])
                        cbPeculiarRequire1.Checked = true;
                    if (cbPeculiarRequire2.Text == cbPeculiarReqList[index])
                        cbPeculiarRequire2.Checked = true;
                    if (cbPeculiarRequire3.Text == cbPeculiarReqList[index])
                        cbPeculiarRequire3.Checked = true;
                    if (cbPeculiarRequire4.Text == cbPeculiarReqList[index])
                        cbPeculiarRequire4.Checked = true;
                    if (cbPeculiarRequire5.Text == cbPeculiarReqList[index])
                        cbPeculiarRequire5.Checked = true;
                    if (cbPeculiarRequire6.Text == cbPeculiarReqList[index])
                        cbPeculiarRequire6.Checked = true;
                } 
                #endregion
               
            
        }
        #endregion

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int cjoid = 0;
            if (Request["CJOID"] != null && Request["CJOID"].ToString().Trim() != "")
            {
                cjoid = int.Parse(Request["CJOID"].ToString());
            }
          
            DataLib.Model.Cjo cModel = new Cjo();
            DataLib.BLL.Cjo cBll = new DataLib.BLL.Cjo();
            cModel = cBll.GetModel(cjoid);

            DataLib.Model.ProjectsRelation pModel = new ProjectsRelation();
            DataLib.BLL.ProjectsRelation pBll = new DataLib.BLL.ProjectsRelation();
            pModel = pBll.GetModel(int.Parse(cModel.addid.ToString()));
            if (pModel == null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Tip", "<script>alert('没有修改权限!')</script>");
            }
            else
            {
                if (Request["CJOID"] != null && Request["CJOID"].ToString().Trim() != "")
                {
                    if (ForEstimat() != "")
                    {
                        MessageBox.Show(Page, ForEstimat());
                        return;
                    }
                    UpdateCommonData(int.Parse(Request["CJOID"].Trim()));
                }
            }
        }

        protected void UpdateCommonData(int cjoId)
        {
            //改为调用存储过程  2013.04.19  梁玲
            Cjo cjoModel = GetCjoModel(cjoId);
            LoadNum lModel = GetLoadModel(cjoModel.loadnumid);
            VehicleRequire vReqModel = GetVehModel((int)cjoModel.id);

            try
            {
                if (new DataLib.BLL.CJOItem().UpdateCjoItem(lModel, cjoModel, vReqModel) == 0)
                {
                    DataLib.Common.MessageBox.ShowAndRedirect(Page, "修改成功！", "/Storage/CJOByLoadID.aspx?loadid=" + lModel.id.ToString());
                }
            }
            catch (Exception ex)
            {
                DataLib.Common.MessageBox.Show(this, ex.Message);
            }

        }
        #region 验证
        /// <summary>
        /// 验证
        /// </summary>
        /// <returns>提示</returns>
        protected string ForEstimat()
        {
            string strErr = "";
            if (!PageValidate.IsNumber(txtLoadNum.Text))
            {
                strErr += "请勿自行修改LoadNum！\\n";
            }
            if (!PageValidate.IsNumber(txtCJO.Text))
            {
                strErr += "请勿自行修改CJO！\\n";
            }

            if (!PageValidate.IsDateTime(txtNoticeDate.Text))
            {
                strErr += "通知日期必须输入且必须为日期格式数据！\\n";
            }
            if (!PageValidate.IsDateTime(txtCollectDate.Text))
            {
                strErr += "收货日期必须输入且必须为日期格式数据！\\n";
            }
            if (!PageValidate.IsDateTime(txtCollectTime.Text))
            {
                strErr += "收货时间必须为时间格式数据！\\n";
            }
            if (txtCustomerCode.Text.Trim().Length == 0)
            {
                strErr += "客户编号不能为空！\\n";
            }
            if (txtCompany.Text.Trim().Length == 0)
            {
                strErr += "客户名称不能为空！\\n";
            }
            if (txtCollectAddress.Text.Trim().Length == 0)
            {
                strErr += "收货地址不能为空！\\n";
            }
            if (txtCustomerContactor.Text.Trim().Length == 0)
            {
                strErr += "客户联系人不能为空！\\n";
            }
            //if (!PageValidate.IsPhone(txtCustomerPhoneNum.Text))
            //{
            //    strErr += "客户联系方式不能为空且必须为数字！\\n";
            //}
            if (txtWorkerCount.Text != "" && txtWorkerCount.Text != null)
            {
                if (!PageValidate.IsNumber(txtWorkerCount.Text))  //根据需求，工人数，预计件数，货物重量可不填  2013.04.17 梁玲  
                {
                    strErr += "工人数不能为空且必须为数字！\\n";
                }
            }
            if (txtGoodsCount.Text != "" && txtGoodsCount.Text != null)
            {
                if (!PageValidate.IsNumber(txtGoodsCount.Text))
                {
                    strErr += "预计件数必须为数字！\\n";
                }
            }
            if (txtGoodsWeight.Text != "" && txtGoodsWeight.Text != null)
            {
                if (!PageValidate.IsNumber(txtGoodsWeight.Text))
                {
                    strErr += "货物重量必须为数字！\\n";
                }
            }
            if (cbMaternRequire1.Checked == false && cbMaternRequire2.Checked == false && cbMaternRequire3.Checked == false)
            {
                strErr += "请选择物料状态！\\n";
            }

            //2013-5-28    肖登科
            if (cbPeculiarRequire1.Checked == false && cbPeculiarRequire2.Checked == false && cbPeculiarRequire3.Checked == false && cbPeculiarRequire4.Checked == false && cbPeculiarRequire5.Checked == false && cbPeculiarRequire6.Checked == false)
            {
                strErr += "请选择特殊要求！\\n";
            }
            if (cbWasteName1.Checked == false && cbWasteName4.Checked == false && cbWasteName5.Checked == false && cbWasteName6.Checked == false)
            {
                strErr += "请选择废弃物类型！\\n";
            }
            if (txtOtherCost.Text != "" && txtOtherCost.Text != null)
            {
                if (!PageValidate.IsNumber(txtOtherCost.Text))
                {
                    strErr += "其他费用必须为数字！\\n";
                }
            }
            return strErr;
        }
        #endregion

        #region 3个对象值

        /// <summary>
        /// 取得LoadNum值
        /// </summary>
        /// <returns></returns>
        public DataLib.Model.LoadNum GetLoadModel(int loadnumid)
        {
            LoadNum lModel = new DataLib.BLL.LoadNum().GetModel(loadnumid);

            lModel.belongarea = lblBelong.Text; ;
            //lModel.collectdate = DateTime.Parse(this.txtCollectDate.Text + " " + txtCollectTime.Text);
            lModel.finishWeight = 0;
            lModel.goodsInfo = txtGoodsInfo.Text;
            lModel.loadnum = txtLoadNum.Text;
            lModel.Rubbisharea = ddlWasteDisposePlace.SelectedValue;
            lModel.RubbishType = GetRubbishType();
            lModel.saleman = txtSaleman.ToolTip;
            lModel.status = 1;
            lModel.totalWeight = 0;
            lModel.Memo = txtmemo.Text;
            
            return lModel;
        }
        /// <summary>
        /// 获取cjo对象
        /// </summary>
        /// <param name="loadNumID"></param>
        /// <returns></returns>
        public DataLib.Model.Cjo GetCjoModel(int cjoid)
        {
            DataLib.Model.Cjo cModel = new DataLib.BLL.Cjo().GetModel(cjoid);
            cModel.cjono = txtCJO.Text;
            //退运直销特殊处理
            if (txtCollectAddress.Text.Trim().IndexOf("自送") >= 0)
            {
                if (cModel.status <= 2)
                    cModel.status = 2;
            }
            else if (hidtyz.Value == "直销")
            {
                if (cModel.status < 2)
                    cModel.status = -2;
            }
            else if (hidtyz.Value == "退运")
            {
                if (cModel.status < 2)
                    cModel.status = -1;
            }
            else if (hidtyz.Value == "服务")
            {
                if (cModel.status < 1)
                    cModel.status = 1;
                else 
                    cModel.status = -3;
            }
            else if (cModel.status < 2)
            {
                if (new DataLib.BLL.VehicleArrange().GetModelByCjoid((int)cModel.id) == null)
                    cModel.status = 1;
                else
                    cModel.status = 2;
            }
            cModel.istyz = hidtyz.Value;
            cModel.createtime = DateTime.Parse(txtNoticeDate.Text);
            cModel.islocal = true;
            cModel.cjoremark = txtmemo.Text;
            User curUser = new User();
            //新增Cjo数据并得到其ID CJO状态改为待派车
            if (Session["UserInfo"] != null)
            {
                curUser = (User)Session["UserInfo"];
                cModel.operman = curUser.UserName;
            }

            if (txtGoodsWeight.Text == null || txtGoodsWeight.Text == "")
            {
                cModel.predictweight = 0;
            }
            else
                cModel.predictweight = decimal.Parse(txtGoodsWeight.Text);
            cModel.cjocolldate = DateTime.Parse(this.txtCollectDate.Text + " " + txtCollectTime.Text);
            
            cModel.goodsdesc = txtGoodsInfo.Text;
            cModel.rubbType = GetRubbishType();

            cModel.belogcity = lblBelong.Text;
            cModel.graphiccity = ddlWasteDisposePlace.SelectedValue;
            cModel.cjoadd = txtCollectAddress.Text;
            cModel.cjolinkman = txtCustomerContactor.Text;
            cModel.cjophone = txtCustomerPhoneNum.Text;
            cModel.bussinesstype = hidbussinesstype.Value;
            return cModel;
        }

        /// <summary>
        /// 获取VehicleRequire对象
        /// </summary>
        /// <returns></returns>
        public DataLib.Model.VehicleRequire GetVehModel(int cjoid)
        {
            DataLib.Model.VehicleRequire vModel = new DataLib.BLL.VehicleRequire().GetModelList(" cjoid=" + cjoid)[0];
            string payType = "";
            if (rblPayType1.Checked)
                payType = rblPayType1.Text;
            if (rblPayType2.Checked)
                payType = rblPayType2.Text;


            if (txtWorkerCount.Text == null || txtWorkerCount.Text == "")
            {
                vModel.workercount = "0";
            }
            else
                vModel.workercount = txtWorkerCount.Text;

            vModel.clearingform = payType;
            if (txtGoodsCount.Text == "" || txtGoodsCount.Text == null)
            {
                vModel.numberestimate = 0;
            }
            else
                vModel.numberestimate = decimal.Parse(txtGoodsCount.Text);

            vModel.maternrequire = GetMaternRequire();
            vModel.samplingrequire = GetSamplingRequire();
            vModel.peculiarrequire = GetPeculiarRequire();
            vModel.otherrequire = txtOtherRequire.Text;
            vModel.other = txtVehiRequire.Text;
            vModel.othervrequire = txtqt.Text;
            vModel.vehiclecount = 0; //暂时没用
            try
            {
                vModel.othercost = decimal.Parse(txtOtherCost.Text.Trim());
            }
            catch
            {
                vModel.othercost = 0;
            }

            vModel.tools = GetToolsStr();
            return vModel;
        }
        #endregion

        /// <summary>
        /// 退运直销直接生成财务数据
        /// </summary>
        public void Sall(int loadid)
        {
            DataLib.Model.FinaceData fModel = new DataLib.Model.FinaceData();
            DataLib.Model.LoadNum lModel = new DataLib.BLL.LoadNum().GetModel(loadid);
            DataLib.Model.Cumtomer cumModel = new DataLib.BLL.Cumtomer().GetModel((int)lModel.customerid);
            fModel.LoadNumID = lModel.id;
            fModel.LoadNumNo = lModel.loadnum;
            fModel.CustomerID = lModel.customerid;
            fModel.CustomerCode = cumModel.customercode;
            fModel.CustomerName = cumModel.companyname;
            fModel.CollecInvoiceDate = "零结算";
            fModel.CollecMoneyDate = "零结算";
            fModel.InvoiceDate = "零结算";
            fModel.PayDate = "零结算";
            DataLib.BLL.FinaceData fdBll = new DataLib.BLL.FinaceData();
            fdBll.Add(fModel);
        }

        #region 多控件值录入
        /// <summary>
        /// 获取废弃物类型
        /// </summary>
        /// <returns></returns>
        public string GetRubbishType()
        {
            string waste = "";

            if (cbWasteName1.Checked)
                waste += cbWasteName1.Text + ";";
            //if (cbWasteName2.Checked)
            //    waste += cbWasteName2.Text + ";";
            //if (cbWasteName3.Checked)
            //    waste += cbWasteName3.Text + ";";
            if (cbWasteName4.Checked)
                waste += cbWasteName4.Text + ";";
            if (cbWasteName5.Checked)
                waste += cbWasteName5.Text + ";";
            if (cbWasteName6.Checked)
                waste += cbWasteName6.Text + ";";
            return waste;
        }

        /// <summary>
        /// 获取工具要求
        /// </summary>
        /// <returns></returns>
        private string GetToolsStr()
        {
            string toolsReq = "";
            if (rbTools1.Checked == true)
                toolsReq += rbTools1.Text + "," + txtTools1.Text + ";";
            if (rbTools2.Checked == true)
                toolsReq += rbTools2.Text + "," + txtTools2.Text + ";";
            if (rbTools3.Checked == true)
                toolsReq += rbTools3.Text + "," + txtTools3.Text + ";";
            if (rbTools4.Checked == true)
                toolsReq += rbTools4.Text + "," + txtTools4.Text + ";";
            if (rbTools5.Checked == true)
                toolsReq += rbTools5.Text + "," + txtTools5.Text + ";";
            if (rbTools6.Checked == true)
                toolsReq += rbTools6.Text + "," + txtTools6.Text + ";";
            return toolsReq;
        }

        /// <summary>
        /// 物料状态选择
        /// </summary>
        /// <returns></returns>
        private string GetMaternRequire()
        {
            string matern = "";
            if (cbMaternRequire1.Checked)
                matern += cbMaternRequire1.Text + ";";
            if (cbMaternRequire2.Checked)
                matern += cbMaternRequire2.Text + ";";
            if (cbMaternRequire3.Checked)
                matern += cbMaternRequire3.Text + ";";
            return matern;
        }

        /// <summary>
        /// 获取采样要求
        /// </summary>
        /// <returns></returns>
        public string GetSamplingRequire()
        {
            string sampling = "";
            if (rblSamplingRequire1.Checked)
                sampling = rblSamplingRequire1.Text;
            if (rblSamplingRequire2.Checked)
                sampling = rblSamplingRequire2.Text;
            if (rblSamplingRequire3.Checked)
                sampling = rblSamplingRequire3.Text;
            return sampling;
        }

        /// <summary>
        /// 特殊要求
        /// </summary>
        /// <returns></returns>
        public string GetPeculiarRequire()
        {
            string peculiar = "";

            if (cbPeculiarRequire1.Checked)
                peculiar += cbPeculiarRequire1.Text + ";";
            if (cbPeculiarRequire2.Checked)
                peculiar += cbPeculiarRequire2.Text + ";";
            if (cbPeculiarRequire3.Checked)
                peculiar += cbPeculiarRequire3.Text + ";";
            if (cbPeculiarRequire4.Checked)
                peculiar += cbPeculiarRequire4.Text + ";";
            if (cbPeculiarRequire5.Checked)
                peculiar += cbPeculiarRequire5.Text + ";";
            if (cbPeculiarRequire6.Checked)
                peculiar += cbPeculiarRequire6.Text + ";";
            return peculiar;
        }
        #endregion
    }
}